<template>
	<view class="parent">
		<view class="title">你是？</view>

		<view class="sex-container">
			<view @click="data.sex = 2">
				<view class="sex-image" :class="{active: data.sex == 2 }">
					<image :src="getImageUrl('ic_sex_female.png')"></image>
				</view>
				<view class="sex-name">女士</view>
			</view>

			<view @click="data.sex = 1">
				<view class="sex-image" :class="{active: data.sex == 1 }">
					<image :src="getImageUrl('ic_sex_male.png')"></image>
				</view>
				<view class="sex-name">男士</view>
			</view>
		</view>

		<zy-register-bottom @next="next">
			<view class="tip"> 性别确认后无法修复</view>
		</zy-register-bottom>
	</view>
</template>

<script>
	import RouteUtil from '@/main/common/RouteUtil.js';
	import CacheUtil from '@/main/common/CacheUtil';
	export default {
		data() {
			return {
				data: {
					sex: '',
					nick: '',
					birthday: '',
					heightId: '',
					weightId: '',
					careerId: '',
					tagIds: '',
					educId: '',
					headPicId: '',
					prId: '',
					cityId: '',
					distId: '',
					passWord: ''
				},
			};
		},
		methods: {
			next() {
				if ('' == this.data.sex) {
					uni.$toast.showToast('请选择性别')
					return
				}
				CacheUtil.setRegisterUser(this.data)
				RouteUtil.toRegisterPassword()
			}
		}
	};
</script>

<style lang="scss" scoped>
	.parent {
		padding: 0 50rpx;

		.title {
			font-weight: bold;
			font-size: 48rpx;
			color: #222;
			margin-top: 200rpx;
		}

		.sex-container {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			width: 100%;
			margin: 50rpx 0;

			.sex-image {
				width: 300rpx;
				height: 300rpx;
				display: flex;
				flex-direction: row;
				justify-content: center;
				align-items: center;

				image {
					width: 260rpx;
					height: 260rpx;
				}
			}

			.active {
				border: 10rpx solid #222;
				border-radius: 50%;
			}

			.sex-name {
				font-size: 36rpx;
				color: #555;
				text-align: center;
				margin-top: 30rpx;

			}
		}

		.tip {
			color: #888;
			font-size: 24rpx;
		}

	}
</style>